<me:VBPRULES x:Class="WPFExcelReport.TMPRULES"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Core"
                    xmlns:me="clr-namespace:WPFExcelReport" 
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"
              xmlns:DR="clr-namespace:WPFExcelReport;assembly=TDRAUFTR" 
                    xmlns:Localization="clr-namespace:Localization;assembly=Localization" 
                   x:Name="TV"
                 Loaded="Window_Loaded">
    <me:VBPRULES.Resources>
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
        <ucd:String2ColorConverter  x:Key="str2color"/>
        <CollectionViewSource  x:Key="vwMaster" />
    </me:VBPRULES.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition   Height="Auto" />
            <RowDefinition   Height="Auto" />
            <RowDefinition   Height="1*" /> 
        </Grid.RowDefinitions> 
        <StackPanel Grid.Row="0" >
            <WrapPanel>
                <DR:TDRAUFTR Name="cDR" Visibility="Collapsed"
                    DocType="LOADEXCEL"  
                             DESTFOLDER="{Binding ART,ElementName=TV}"
                             PREFIX="{Binding VAR,ElementName=TV}"
                             />
                <Button Margin="15,0,0,0" Content="{Binding Source={Localization:Translate Word=外部导入}}" Click="LoadExcelCommand"></Button>
                <TextBox Text="{Binding ART,ElementName=TV}" Width="200"/>
                <TextBox Text="{Binding VAR,ElementName=TV}" Width="60"/>
            </WrapPanel>
            <WrapPanel >
                <Button Margin="15,0,0,0" Content="{Binding Source={Localization:Translate Word=查询}}" Click="QueryCommand"></Button>
                <Button Margin="15,0,0,0" Content="{Binding Source={Localization:Translate Word=新建}}" Click="NewCommand"></Button>
                <CheckBox Content="{Binding Source={Localization:Translate Word=新流水起始}}" IsChecked="False" Name="ChkSeq"/>
                <Button Margin="15,0,0,0" Content="{Binding Source={Localization:Translate Word=重置流水号}}" Click="ResetSeq"></Button>
                <Button Margin="15,0,0,0" Content="{Binding Source={Localization:Translate Word=编辑}}" Click="EditCommand"></Button>
                <Button Margin="15,0,0,0" Content="{Binding Source={Localization:Translate Word=复制}}" Click="CopyCommand"></Button>
                 <Button Margin="15,0,0,0" Content="{Binding Source={Localization:Translate Word=保存}}" Click="SaveCommand"></Button>
                <Button Margin="15,0,0,0" Content="{Binding Source={Localization:Translate Word=取消}}" Click="DeleteCommand"></Button>
            </WrapPanel>
            
        </StackPanel>
        <DataGrid  Grid.Row="2"  
                              AutoGenerateColumns="False"
                              EnableRowVirtualization="True"  
                              ItemsSource="{Binding Source={StaticResource vwMaster}}"  
                              HeadersVisibility="Column"                           
                              ScrollViewer.HorizontalScrollBarVisibility="Auto"
                              ScrollViewer.VerticalScrollBarVisibility="Auto" Margin="0,0,0,0" 
                              >
            <DataGrid.Columns>
                <DataGridTextColumn Binding="{Binding Path=ROWNID}" Header="{Binding Source={Localization:TranslateExtension Word=ROWNID}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=PLANID}" Header="{Binding Source={Localization:TranslateExtension Word=PLANID}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=ORDERNUM}" Header="{Binding Source={Localization:TranslateExtension Word=ORDERNUM}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=RULEID}" Header="{Binding Source={Localization:TranslateExtension Word=RULEID}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=ARTSTAGE, Converter={StaticResource ResourceKey=gb2312}}" Header="{Binding Source={Localization:TranslateExtension Word=阶段}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=AUFTYP, Converter={StaticResource ResourceKey=gb2312}}" Header="{Binding Source={Localization:TranslateExtension Word=订单类型}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=R01}" Header="{Binding Source={Localization:TranslateExtension Word=比例1}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=R01DES, Converter={StaticResource ResourceKey=gb2312}}" Header="{Binding Source={Localization:TranslateExtension Word=类型}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=R02}" Header="{Binding Source={Localization:TranslateExtension Word=比例2}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=R02DES, Converter={StaticResource ResourceKey=gb2312}}" Header="{Binding Source={Localization:TranslateExtension Word=类型}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=F01}" Header="{Binding Source={Localization:TranslateExtension Word=数量1}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=F01DES, Converter={StaticResource ResourceKey=gb2312}}" Header="{Binding Source={Localization:TranslateExtension Word=类型}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=F02}" Header="{Binding Source={Localization:TranslateExtension Word=数量2}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=F02DES, Converter={StaticResource ResourceKey=gb2312}}" Header="{Binding Source={Localization:TranslateExtension Word=类型}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=JNUM}" Header="{Binding Source={Localization:TranslateExtension Word=个数}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=JNUMDES, Converter={StaticResource ResourceKey=gb2312}}" Header="{Binding Source={Localization:TranslateExtension Word=类型}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=JWASTGE}" Header="{Binding Source={Localization:TranslateExtension Word=数量}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=JWASTAGEDES, Converter={StaticResource ResourceKey=gb2312}}" Header="{Binding Source={Localization:TranslateExtension Word=类型}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=REMARK, Converter={StaticResource ResourceKey=gb2312}}" Header="{Binding Source={Localization:TranslateExtension Word=备注}}"  Width="Auto" />
            </DataGrid.Columns>
        </DataGrid>
    </Grid>
</me:VBPRULES>
